﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Parichay.Data.Helper;
using Parichay.Domain;

namespace Parichay.Data.Repository
{
    public class MemberUploadsRepository :Parichay.Domain.Interface.Data.IMemberUploadsRepository
    {
        public IList<MemberUploads> getMemberUploadsByUserId(object userId, int pageSize, int pageIndex)
        {
            IList<MemberUploads> myFiles = NHibernateHelper.FetchProjection<MemberUploads>(new string[] { "Id", "Attachmt", "FileSize", "CreateD" }, "Owner.Id", int.Parse(userId.ToString()), pageIndex, pageSize, false, null, false);
            return (myFiles);
        }

        public MemberUploads getMemberUploadById(int id)
        {
            MemberUploads itm = NHibernateHelper.UniqueResult<MemberUploads>(null, "Id", id);
            return (itm);
        }
    }
}
